addrx="/home/actorsun/robot_ws/install/gazebo_pkg/share/gazebo_pkg";
addry="/home/actorsun/robot_ws/src/gazebo_pkg";
export ROS_LOCALHOST_ONLY=1
mkdir -p $addrx;
cp ${addry}/urdf/total.xacro ${addrx}/urdf/total.xacro
cd ~/robot_ws&&colcon build&&source install/setup.bash;
str1="${addrx}/urdf/total.xacro"
str2="${addrx}/urdf/total.urdf"
ros2 run xacro xacro $str1 > $str2
while  test '1' = '1'
do
    if [ -e ${str2} ]
    then
    	echo 'transformed success'
        break
    else
        sleep 1
    	echo 'wait for tranlate from '${str1}' to '${str2}
    fi
done
source ~/robot_ws/install/setup.bash
source /usr/share/gazebo-11/setup.bash
ros2 launch gazebo_pkg launch.xml
